package com.fanshuai.algorithms.backtrack;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        //testPermute();
        //testEightQueen();

        testCombine();
    }

    private static void testPermute() {
        Permute combine = new Permute();

        int[] a = {2, 3, 5, 7};
        List<List<Integer>> combines = combine.permute(a);
        //combines.forEach(System.out::println);

        List<int[]> combines2 = combine.permute2(a);
        combines2.forEach(c -> {
            for (int i = 0; i < c.length; i++) {
                System.out.print(c[i] + " ");
            }
            System.out.println();
        });
    }

    private static void testEightQueen() {
        EightQueen eightQueen = new EightQueen();
        List<List<Integer>> queens = eightQueen.eightQueen();

        queens.forEach(System.out::println);
    }

    private static void testCombine() {
        int[] a = {1, 2, 3, 4};

        Combine combine = new Combine();
        List<List<Integer>> subsets = combine.subsets(a);
        subsets.forEach(System.out::println);

        List<List<Integer>> combines = combine.combine(5, 3);
        combines.forEach(System.out::println);
    }
}
